/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import org.fusesource.jansi.Ansi;
import org.fusesource.jansi.AnsiConsole;

import java.util.Random;

/**
 * <p>Project: jse2302 - JansiDemo
 * <p>Powered by webrx On 2023-06-12 11:09:45
 * <p>Created by IntelliJ IDEA
 *
 * @author  webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class JansiDemo {
    public static void main(String[] args) {
        AnsiConsole.systemInstall();
        //System.out.println(Ansi.ansi().fg(Ansi.Color.GREEN).a("hello world").reset());
        //System.out.println("ok");
        Random rand = new Random();

        for (int q = 1; q <= 100; q++) {
            int red = rand.nextInt(256);
            int green = rand.nextInt(256);
            int blue = rand.nextInt(256);
            int bred = rand.nextInt(256);
            int bgreen = rand.nextInt(256);
            int bblue = rand.nextInt(256);
            System.out.print(Ansi.ansi().fgRgb(red, green, blue).bgRgb(bred,bgreen,bblue).a("hello - jansi").reset()+"    ");
            if(q%5 == 0){
                System.out.println();
            }
        }
        AnsiConsole.systemUninstall();
    }
}
